#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
int main(int argc, char **argv)
{
     int fd;
     fd = open("/dev/memfifo",O_RDWR);
     if(fd== -1)
     {
	  printf("open /dev/memfifo failed\n");
	  return -1;
	  
     }
     
     int a = 5;
     int temp;
     int i;
     
     int ret;
   
     while(1)
     {
	  
        ret = read(fd,(void*)&temp,sizeof(int));
	printf ("ret = %d \n",ret);
     
     if(ret != -1)
     {
	  printf("read %d  successed\n",temp);
	  
	  
     }
     
     }
     
   
     
     
  return 0;
}
